<style>
    .layui-btn:not(.layui-btn-lg ):not(.layui-btn-sm):not(.layui-btn-xs) {
        height: 34px;
        line-height: 34px;
        padding: 0 8px;
    }
</style>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li><a href="{:url('main.seoLog/index')}">推送记录</a></li>
                <li class="layui-this">SEO配置</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="seo">
                        <div class="layui-form-item">
                            <label class="layui-form-label">首页SEO名称</label>
                            <div class="layui-input-inline">
                                <input type="text" name="home_name" value="{:sysconfig('seo.home_name')}"
                                       autocomplete="off" class="layui-input">
                                <tip>更利于SEO收录
                                </tip>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">网站地图生成文章数量</label>
                            <div class="layui-input-inline">
                                <input type="text" name="article_sitemap_num" value="{:sysconfig('seo.article_sitemap_num')}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">百度普通收录接口</label>
                            <div class="layui-input-block">
                                <input type="text" name="baidu_api" value="{:sysconfig('seo.baidu_api')}"
                                       autocomplete="off" class="layui-input">
                                <tip><a href="https://ziyuan.baidu.com/linksubmit/index" target="_blank">百度资源平台</a>
                                </tip>
                            </div>
                        </div>
                        <a class="layui-btn layui-btn-normal layui-btn-sm" onclick="push2baidu('today')" data-refresh="false">推送今日新增</a>
                        <a class="layui-btn layui-btn-normal layui-btn-sm"  onclick="push2baidu('sevenDays')" data-refresh="false">推送7日内新增</a>
                        <a class="layui-btn layui-btn-normal layui-btn-sm"  onclick="push2baidu('cates')" data-refresh="false">推送全部栏目页</a>
                        <a class="layui-btn layui-btn-normal layui-btn-sm"  onclick="push2baidu('sysTags')" data-refresh="false">推送系统标签</a>
                        <a class="layui-btn layui-btn-normal layui-btn-sm"  onclick="push2baidu('hotTags')" data-refresh="false">推送热门标签Top20</a>
                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm"
                                    lay-submit="system.config/save" data-refresh="false">确认
                            </button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function push2baidu(type) {
        var loading = layer.load(0, {shade: false, time: 2 * 1000});
        $.post("{:url('main.seoLog/push2seo')}", {type: type}, function (res) {
            layer.close(loading);
            if (res.code == 1) {
                layer.msg(res.msg);
            } else {
                layer.alert(res.msg);

            }
        });
    }
</script>



